import request from "@/utils/request";

const baseURL = "/system/poster";

export interface Poster {
  id: string;
  posterUrl: string;
  posterType: number;
  qrCodeWidth: number; //二维码宽
  qrCodeHeight: number; // 二维码高
  qrCodePositionTop: number; //上边距
  qrCodePositionRight: number; //右边距
  qrCodePositionBottom: number; //下边距
  qrCodePositionLeft: number; //左边距
  ifSwitch: number; //是否开启
}

// 设置选中海报
export const setPoster = (data: { id: string }) =>
  request<boolean>({
    url: `${baseURL}/set-poster`,
    method: "PUT",
    data,
  });

//   分页获取海报列表
export const pagePoster = ( data: PageParams & { posterType?: string }) =>
  request<PageResult<Poster>>({
    url: `${baseURL}/page-poster`,
    method: "POST",
    data,
  });

// 获取海报详情
export const detailPoster = ( params:{id:string}) =>
  request<PageResult<Poster>>({
    url: `${baseURL}/get-poster-detail`,
    method: "GET",
    params
  });
